package com.pattern.once.prototype;

/***
 * 原型模式
 *  1 浅拷贝
 *  2 深拷贝
 *
 * 拷贝后的类的地址不一样 类的hashcode 也不一样
 *
 */
public class Prototype implements Cloneable {


    private Integer id;

    private String  name;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Prototype() {
    }

    public Prototype(Integer id, String name) {
        this.id = id;
        this.name = name;
    }
}
